/**
 * 
 */
package quartz.listener;

import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.SchedulerException;
import org.quartz.SchedulerListener;
import org.quartz.Trigger;
import org.quartz.TriggerKey;

/**
 * 
 *
 * @author Gavin<br>
 *         2020年6月17日
 */
public class MySchedulerListener implements SchedulerListener {

	/* 
	 */
	@Override
	public void jobScheduled(Trigger trigger) {
		String name = trigger.getKey().getName();
		// 用于部署JobDetail时调用
		System.out.println(name + "完成部署");

	}

	/* 
	 */
	@Override
	public void jobUnscheduled(TriggerKey triggerKey) {
		// 用于卸载时候调用
		String name = triggerKey.getName();
		System.out.println(name + "完成卸载");

	}

	/* 
	 */
	@Override
	public void triggerFinalized(Trigger trigger) {
		String name = trigger.getKey().getName();
		// 当一个Trigger来到了再也不会触发的状态时调用这个方法。除非这个Job已设置成了持久性，否则它就会从Scheduler中移除
		System.out.println(name + "触发器被移除");

	}

	/* 
	 */
	@Override
	public void triggerPaused(TriggerKey triggerKey) {
		System.out.println("触发器被暂停");

	}

	/* 
	 */
	@Override
	public void triggersPaused(String triggerGroup) {
		System.out.println("触发器组被暂停");

	}

	/* 
	 */
	@Override
	public void triggerResumed(TriggerKey triggerKey) {
		System.out.println("触发器从暂停中恢复");

	}

	/* 
	 */
	@Override
	public void triggersResumed(String triggerGroup) {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void jobAdded(JobDetail jobDetail) {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void jobDeleted(JobKey jobKey) {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void jobPaused(JobKey jobKey) {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void jobsPaused(String jobGroup) {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void jobResumed(JobKey jobKey) {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void jobsResumed(String jobGroup) {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void schedulerError(String msg, SchedulerException cause) {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void schedulerInStandbyMode() {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void schedulerStarted() {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void schedulerStarting() {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void schedulerShutdown() {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void schedulerShuttingdown() {
		// TODO Auto-generated method stub

	}

	/* 
	 */
	@Override
	public void schedulingDataCleared() {
		// TODO Auto-generated method stub

	}

}
